import LoadingSpinner from './LoadingSpinner.vue'
import ErrorAlert from './ErrorAlert.vue'
import Notification from './Notification.vue'

export default {
  install(app) {
    // 注册全局组件
    app.component('LoadingSpinner', LoadingSpinner)
    app.component('ErrorAlert', ErrorAlert)
    app.component('Notification', Notification)
    
    // 添加全局属性
    app.config.globalProperties.$notify = (title, message, type = 'info', timeout = 5000) => {
      window.dispatchEvent(new CustomEvent('notification', {
        detail: { title, message, type, timeout }
      }))
    }
  }
}